<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Entry>" %>

<asp:Content ContentPlaceHolderID="TitleContent" runat="server"><%= Model.Title %></asp:Content>
<asp:Content ContentPlaceHolderID="MetaDescription" runat="server">
    <meta name="description" content="<%= Model.GetTeaserText() %>" />
    <meta name="keywords" content="<%= Model.GetMetaKeywordsString() %>" />
</asp:Content>
<asp:Content ContentPlaceHolderID="PrimaryMainContent" runat="server">
    <h1><%= Model.Title %></h1>
    <span class="entryInfo">
        Posted <%= String.Format("{0:g}", Model.PublicationStart.ToSiteStandardString())%> 
        <% if(Model.GetBlogCategories().Count() > 0) {%>
            in 
            <% foreach (DescriptiveListItem<ICategory> categoryItem in Model.GetBlogCategories().ToDescriptiveList()) {%>
                <a href="<%= categoryItem.Item.GetUrl(ViewContext.RequestContext) %>"><%= categoryItem.Item.Name %></a>
                <% if(!categoryItem.Is(ItemDescription.Last)) {%>
                    |
                <%} %>
            <% } %>
        <% }%>
        .
        <span class="numComments">
            <a href="#comments" class="commentsLink">
                <%= Model.GetNumComments() %> comments.</span>
            </a>
        </span>
    </span>
    <%= Model.Content %>
    <p><i>PS. For updates about new posts, sites I find useful and the occasional rant you can <a href="http://twitter.com/joelabrahamsson">follow me on Twitter</a>. You are also most welcome to subscribe to <a href="http://feeds.feedburner.com/JoelAbrahamsson">the RSS-feed.</a></i></p>
    <div class="entryFooter">
        <% if (Model.Tags.Count > 0) { %>
            <span class="tags">Tags: 
                <% foreach (DescriptiveListItem<ITag> tagItem in Model.Tags.ToDescriptiveList())
                   { %>
                   <a href="<%= tagItem.Item.GetUrl(ViewContext.RequestContext) %>"><%= tagItem.Item.Name%></a>
                   <% if (!tagItem.Is(ItemDescription.Last))
                      {%>
                    |
                   <% } %>
                <% } %>
            </span>
        <% } %>
        <span class="commentLink"><a href="#addComment">Add a comment!</a></span>
        <%
           Html.RenderAction("Index", "RelatedEntries", new {entry = Model}); %>
        <div class="clear"></div>
    </div>
    
</asp:Content>
<asp:Content ContentPlaceHolderID="SecondaryMainContent" runat="server">
    <% Html.RenderPartial("LoveBox", Model); %>
    <% Html.RenderPartial("CommentsList", Model); %>
    <% Html.RenderPartial("CommentForm", Model); %>
</asp:Content>
